/**
 * Created by CodeTlan.
 * User: hellreuter
 * Date: 3/30/12
 * Time: 12:01 PM
 */
Ext.define('CT.view.militancia.Grid', {
    extend: 'Ctc.view.EditorGrid',
    alias:"widget.gridmilitancia",
    store:'Militancias',
    requires: 'Ext.ux.grid.checkcolumn.CheckColumn',
    buildColumns: function(){
        return [
            { xtype: 'rownumberer'},
            { header: 'Actividad',dataIndex: 'actividad', flex: '4', editor:{ allowBlank: false}  },
            { header: 'Fecha', dataIndex: 'fecha', align: 'center', width: 80, editor: { xtype: 'datemx', allowBlank: false }, renderer:Ext.util.Format.dateRenderer('d/m/Y')},
            { dataIndex: 'activo', width: 40, align: 'center', xtype: 'checkcolumn', editor: { xtype: 'checkbox', cls: 'x-grid-checkheader-editor' }},
            { align: 'center', width: 30, renderer: this._renderEliminar, editor:{xtype:'hiddenfield'}}
        ];
    },
    buildTbar: function(){
        return [{
            xtype: 'button',
            itemId:'btnTrabajadores',
            action:'addTrabajador',
            text: 'Agregar Trabajadores',
            iconCls: 'add',
            disabled: 'true'
        }];
    },
    _renderEliminar: function(value){
        return "<img src='img/icons/16/del.png' style:'cursor:pointer'>";
    }
});